package com.gitee.cashzhang27.test.sdk.bestsign.domain;

import java.util.Objects;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author Cash Zhang
 * @version v1.0
 * @since 2019/08/05 13:50
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class DefaultBestSignResponse extends AbstractBestSignResponse {

  /**
   * 错误码, 如果为0表示成功没有错误
   */
  private int errno;
  /**
   * 输出数据 （如果有的话，具体内容和每一个具体的接口相关）
   */
  private String data;
  /**
   * 接口处理花费的时间
   */
  private long cost;
  /**
   * 错误描述，结合errno对照附录
   */
  private String errmsg;

  public final int getErrno() {
    return errno;
  }

  public final void setErrno(int errno) {
    this.errno = errno;
  }

  public final String getData() {
    return data;
  }

  public final void setData(String data) {
    this.data = data;
  }

  public final long getCost() {
    return cost;
  }

  public final void setCost(long cost) {
    this.cost = cost;
  }

  public final String getErrmsg() {
    return errmsg;
  }

  public final void setErrmsg(String errmsg) {
    this.errmsg = errmsg;
  }

  public final boolean isSuccess() {
    return Objects.equals(this.errno, 0);
  }

}
